package cn.school.demo.ui.party_history_answer

import androidx.fragment.app.FragmentManager
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import cn.school.demo.MyApplication
import cn.school.demo.pojo.Result
import cn.school.demo.pojo.Test
import cn.school.demo.repository.AnswerRepository


class PartyHistoryAnswerViewModel : ViewModel() {
    val DAILYQUIZ = 1
    val WEEKLYQUIZ = 2
    val SPECIALQuestion = 3

    private lateinit var _testList: LiveData<MutableList<Test>>
    val testList: LiveData<MutableList<Test>> get() = _testList

    fun getDayResult(f: FragmentManager) {
        _testList =
            AnswerRepository().getPartyHistoryAnswer(MyApplication.user!!.sfNumber, "每日党史答题", null, f)
    }

    fun getWeekResult(f: FragmentManager) {
        _testList =
            AnswerRepository().getPartyHistoryAnswer(MyApplication.user!!.sfNumber, "每周党史答题", null,f)
    }
}